﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace ReportingSystem.Model
{
    /// <summary>
    /// 报修表
    /// </summary>
    public class Repairs:EntityBase
    {
        /// <summary>
        /// 申报时间
        /// </summary>
        
        [Display(Name = "申报时间")]
        public DateTime beginTime { get; set; }

        /// <summary>
        /// 修理时间
        /// </summary>
        [Display(Name = "修理时间")]
        public DateTime endTime { get; set; }

        /// <summary>
        /// 地点
        /// </summary>
        
        [Display(Name = "地点")]
        public string place { get; set; }

        /// <summary>
        /// 故障物品
        /// </summary>
        
        [Display(Name = "物品")]
        public string goods{ get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        
        [Display(Name = "描述")]
        public string content { get; set; }

        /// <summary>
        /// 评价
        /// </summary>
        [Display(Name = "评价")]
        public string evaluate { get; set; }

        /// <summary>
        /// 图片result
        /// </summary>
        [Display(Name = "图片")]
        public string picture { get; set; }

        /// <summary>
        /// 结果
        /// </summary>
        [Display(Name = "结果")]
        public string result { get; set; }

        /// <summary>
        /// 枚举状态0=="待维修"，1=="完成"
        /// </summary>
        
        [Display(Name = "状态")]
        public int state { get; set; }

        //枚举状态0=="启用"，1=="禁用"
        public string states
        {
            get
            {
                if (state == 0)
                { return "待维修"; }
                else { return "完成"; }
            }
        }

        //外键
        //一格表对应一个学生和一个维修员
        public virtual List<User> Users { get; set; }
    }
}
